/*
 *    Copyright (c) 2014 Xiang Xu <xuxiang@mail.bnu.edu.cn>
 *
 *    Permission is hereby granted, free of charge, to any person
 *    obtaining a copy of this software and associated documentation
 *    files (the "Software"), to deal in the Software without
 *    restriction, including without limitation the rights to use,
 *    copy, modify, merge, publish, distribute, sublicense, and/or sell
 *    copies of the Software, and to permit persons to whom the
 *    Software is furnished to do so, subject to the following
 *    conditions:
 *
 *    The above copyright notice and this permission notice shall be
 *    included in all copies or substantial portions of the Software.
 *
 *    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 *    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 *    OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 *    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 *    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 *    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 *    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 *    OTHER DEALINGS IN THE SOFTWARE.
 */

#ifndef SHAPE_GRAMMAR_H
#define SHAPE_GRAMMAR_H

#include <vector>
#include <string>

//! Shape grammar rule define.
/*!
 * It contains all the elements that a grammar rule has.
 * A rule is of this format:
 * [left_hand_symbol parameter, apply_direction] --> [right_hand_symbol1_ + right_hand_symbol2_] or [exception_symbol].
 */
struct ShapeGrammar
{
    std::string name_;						/*!< Rule name. */
    int apply_direction_;					/*!< 0 -- vertical rule; 1 -- horizonal rule. */
    std::string left_hand_symbol_;			/*!< Left hand symbol. */
    std::string right_hand_symbol1_;		/*!< First right hand symbol. */
    std::string right_hand_symbol2_;		/*!< Second right hand symbol. */
    std::string exception_symbol_;			/*!< Exception symbol. */
    // three different methods to specify parameter
    std::string symbol_parameter_;
    std::vector<int> value_parameter_;
    std::vector<int> parameter_range_;
};


#endif // SHAPE_GRAMMAR_H
